package com.projectzqjz.parttimework.utils;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.projectzqjz.parttimework.R;

public class NewsToastUtils {
    @SuppressLint("SetTextI18n")
    public static void showToast(Context context, String str) {
        Toast toast2 = new Toast(context);
        View view = LayoutInflater.from(context).inflate(R.layout.toast_layout, null);
        TextView tv = view.findViewById(R.id.tv_toast);
        tv.setText(str+"");
        toast2.setView(view);
        toast2.setGravity(Gravity.CENTER, 0, 0);
        toast2.show();
    }
}
